﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.orrg/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Dribble Ball</title>
    <link rel="stylesheet" href="../css/db.css" />
    <link rel="stylesheet" href="../css/colorbox.css" />
    <script type="text/javascript" src="../js/track.js" />
</head>
<body>
    <div id="status">
        <div id="counter">
        </div>
    </div>
    <div id="win">
        <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
            width="1600" height="1300" version="1.1">
            <defs>
                <marker id="mTriangle" markerWidth="50" markerHeight="100" refX="50" refY="50" orient="auto">
                    <path d="M 0 0 50 50 0 100 Z" style="fill: black;" />
                </marker>
                <path id="direction" stroke="#000000" d="m-10.60661,28.19893c-2.57361,-1.51245 -2.23609,-2.42815 4.02107,-10.90557c3.15933,-4.28057 5.74433,-7.90729 5.74433,-8.05942c0,-0.15191 -8.72451,-0.27635 -19.38756,-0.27635l-19.38774,0l0,-8.01723l0,-8.01712l19.5413,0c15.06768,0 19.37321,-0.24151 18.80682,-1.05485c-0.40398,-0.5803 -3.16043,-4.43034 -6.12494,-8.55574c-5.58802,-7.7766 -5.58636,-9.86195 0.00884,-10.50849c2.78446,-0.32158 46.13598,24.39523 47.62597,27.15416c-14.43994,9.8506 -31.70061,20.16171 -47.60056,29.25328c-0.83834,0 -2.29997,-0.45575 -3.24752,-1.01267l-0.00001,0.00001z"
                    stroke-width="5" fill="#ff0000">
                    <animateTransform attributeName="transform" attributeType="XML" type="scale" values="1;1.1;1"
                        dur="1s" fill="freeze" repeatCount="indefinite" />
                    <animate attributeType="css" attributeName="opacity" values="0.9;1;0.9" dur="1s"
                        fill="freeze" repeatCount="indefinite" />
                </path>
            </defs>
            <linearGradient id="grad1" x1="0%" y1="0%" x2="0%" y2="100%">
                <stop offset="0%" style="stop-color: #F2E2CB; stop-opacity: 0.4" />
                <stop offset="100%" style="stop-color: #1B6325; stop-opacity: 0.4" />
            </linearGradient>
            <g id="back">
                <rect width="100%" height="100%" fill="url(#grad1)" />
            </g>
            <g id="main">
                <line x1="0" y1="200" x2="550" y2="200" db-pad="wood" />
                <line x1="550" y1="200" x2="550" y2="250" db-pad="wood" />
                <line x1="550" y1="250" x2="0" y2="250" db-pad="wood" />
                <g transform="translate(240 290)" db-cat="reward" />
                <line x1="0" y1="600" x2="600" y2="600" db-pad="bad" />
                <line x1="400" y1="550" x2="900" y2="550" db-pad="ground" />
                <!--down-->
                <use xlink:href="#direction" transform="translate(1100 500) rotate(90)" />
                <line x1="900" y1="550" x2="900" y2="1550" db-pad="ground" />
                <line x1="1400" y1="650" x2="1400" y2="0" db-pad="ground" />
                <line x1="1600" y1="650" x2="1400" y2="650" db-pad="wood" />
                <line x1="1600" y1="950" x2="1600" y2="650" db-pad="wood" />
                <line x1="1400" y1="950" x2="1600" y2="950" db-pad="wood" />
                <g transform="translate(1500 825)" db-cat="reward" />
                <line x1="1400" y1="1550" x2="1400" y2="950" db-pad="ground" />
                <g transform="translate(1050 1100)" db-cat="reward" />
                <!--target-->
                <line id="target1" x1="950" y1="1200" x2="1110" y2="1200" db-cat="target" />
                <line id="target2" x2="950" y2="1205" x1="1110" y1="1205" db-pad="wood" />
                <circle id="target3" cx="950" cy="1200" r="6" db-pad="wood" />
                <circle id="target4" cx="1110" cy="1200" r="6" db-pad="wood" />
            </g>
            <rect id="dummy" width="100%" height="100%" fill-opacity="0">
            </rect>
            <g id="front">
            </g>
        </svg>
    </div>
    <div id="skip">
        &lt;&lt; Skip Preview
    </div>
    <script type="text/javascript" src="../js/jquery.js"></script>
    <script type="text/javascript" src="../js/jquery.countdown.js"></script>
    <script type="text/javascript" src="../js/jquery.colorbox.js"></script>
    <script type="text/javascript" src="../js/svg.js"></script>
    <script type="text/javascript" src="../js/db.js"></script>
    <script type="text/javascript">
        //<![CDATA[
        $(function () {
            db.path = [{ x: 0, y: 300 }, { x: 1150, y: 300 }, { x: 1150, y: 1550}];
            db.isInBoundary = function (x, y) {
                return y < 1300;
            };

            var dir3 = 1;
            var x3 = 950;

            db.setTimer(null, function () {
                //target
                if (x3 < 900 || x3 > 1240)
                    dir3 *= -1;
                x3 += dir3;
                $("#target1").attr({ "db-speed-x": dir3, x1: x3, x2: x3 + 160 });
                $("#main image[class='target']").attr("x", x3);
                $("#target2").attr({ "db-speed-x": dir3, x2: x3, x1: x3 + 160 });
                $("#target3").attr({ "db-speed-x": dir3, cx: x3 });
                $("#target4").attr({ "db-speed-x": dir3, cx: x3 + 160 });
            });

            //highlightDesign();
            startGame();
        });
        //]]>
    </script>
</body>
</html>
